package cmm;

public class MidCode {
    private int number;                  //中间代码的行号
    private OpType op;                   //操作符
    private String arg1;                 //左侧操作数
    private String arg2;                 //右侧操作数
    private String result;               //临时变量名称，或者中间代码跳转的位置
    private int lineNo;                  //实际代码的位置

    public MidCode(int number, OpType op, String arg1, String arg2, String result,int lineNo) {
        this.number = number;
        this.op = op;
        this.arg1 = arg1;
        this.arg2 = arg2;
        this.result = result;
        this.lineNo=lineNo;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public OpType getOp() {
        return op;
    }

    public void setOp(OpType op) {
        this.op = op;
    }

    public String getArg1() {
        return arg1;
    }

    public void setArg1(String arg1) {
        this.arg1 = arg1;
    }

    public String getArg2() {
        return arg2;
    }

    public void setArg2(String arg2) {
        this.arg2 = arg2;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result)
    {
        this.result = result;
    }

    public int getLineNo() {
        return lineNo;
    }

    public void setLineNo(int lineNo) {
        this.lineNo = lineNo;
    }
}
